@model WarehouseSearchModel

@{    
    //page title
    ViewBag.Title = T("Admin.Configuration.Shipping.Warehouses").Text;
    //active menu item (system name)
    Html.SetActiveMenuItemSystemName("Warehouses");
}

<nop-antiforgery-token />
<div class="content-header clearfix">
    <h1 class="pull-left">
        @T("Admin.Configuration.Shipping.Warehouses")
    </h1>
    <div class="pull-right">
        <a asp-action="CreateWarehouse" class="btn bg-blue">
            <i class="fa fa-plus-square"></i>
            @T("Admin.Common.AddNew")
        </a>
        @await Component.InvokeAsync("AdminWidget", new { widgetZone = AdminWidgetZones.WarehouseListButtons })
    </div>
</div>

<div class="content">
    <div class="form-horizontal">
        <div class="panel-group">
            <div class="panel panel-default">
                <div class="panel-body">
                    @await Html.PartialAsync("Table", new DataTablesModel
                    {
                        Name = "warehouse-grid",
                        UrlRead = new DataUrl("Warehouses", "Shipping", null),
                        Length = Model.PageSize,
                        LengthMenu = Model.AvailablePageSizes,
                        ColumnCollection = new List<ColumnProperty>
                        {
                            new ColumnProperty(nameof(WarehouseModel.Name))
                            {
                                Title = T("Admin.Configuration.Shipping.Warehouses.Fields.Name").Text
                            },

                            new ColumnProperty(nameof(WarehouseModel.Id))
                            {
                                Title = T("Admin.Common.Edit").Text,
                                Width = "100",
                                ClassName =  NopColumnClassDefaults.Button,
                                Render = new RenderButtonEdit(new DataUrl("EditWarehouse"))
                            }
                        }
                    })
                </div>
            </div>
        </div>
    </div>
</div>